package com.lfnyxy.eenum;

import com.lfnyxy.common.cnst.AppString;

/**
 * Created by ted on 17/9/11.
 * 操作结果通用类。定义所有可能出现的异常结果。
 */
public enum PubStatus {
    ALLOW_APPLY(1, "允许申请"),

    UNKNOW(-999, AppString.UnKnow);

    PubStatus(int code, String content) {
        this.code = code;
        this.content = content;
    }

    private int code;
    private String content;

    public int getCode() {
        return code;
    }

    public String getContent() {
        return content;
    }

    public static PubStatus valueOf(int code){
        for(PubStatus item: values()){
            if(item.getCode() == code){
                return item;
            }
        }
        return UNKNOW;
    }
}
